﻿package mortal.game.view.systemSetting.command
{
    import Framework.MQ.*;
    import Message.Public.*;
    import com.gengine.debug.*;
    import flash.utils.*;
    import frEngine.util.*;
    import mortal.common.shortcutsKey.*;
    import mortal.game.cache.*;
    import mortal.game.mvc.*;
    import mortal.game.net.broadCast.*;
    import mortal.game.view.systemSetting.*;
    import mortal.mvc.core.*;

    public class SystemSettingCommand extends BroadCastCall
    {

        public function SystemSettingCommand(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function call(param1:MessageBlock) : void
        {
            var _loc_4:String = null;
            var _loc_5:int = 0;
            var _loc_6:String = null;
            var _loc_2:* = (param1.messageBase as SPublicDictIntStr).publicDictIntStr;
            var _loc_3:Array = [];
            _loc_3[SystemSettingType.SystemKeyMapData] = _loc_2[SystemSettingType.SystemKeyMapData];
            _loc_3[SystemSettingType.ShortcutBarData] = _loc_2[SystemSettingType.ShortcutBarData];
            _loc_3[SystemSettingType.SystemSetting] = _loc_2[SystemSettingType.SystemSetting];
            _loc_3[SystemSettingType.ClientSetting] = _loc_2[SystemSettingType.ClientSetting];
            _loc_3[SystemSettingType.ExSkillShortcutBarData] = _loc_2[SystemSettingType.ExSkillShortcutBarData];
            for (_loc_4 in _loc_3)
            {
                
                _loc_5 = int(_loc_4);
                _loc_6 = _loc_2[_loc_4] as String;
                switch(_loc_5)
                {
                    case SystemSettingType.SystemKeyMapData:
                    {
                        Log.system("SystemSettingType.SystemKeyMapData: " + _loc_6);
                        ShortcutsKey.instance.setServerStr(_loc_6);
                        break;
                    }
                    case SystemSettingType.ShortcutBarData:
                    {
                        Log.system("SystemSettingType.ShortcutBarData: " + _loc_6);
                        Cache.instance.shortcut.initData(_loc_6);
                        NetDispatcher.dispatchCmd(ServerCommand.ShortcutBarDataUpdate, null);
                        break;
                    }
                    case SystemSettingType.SystemSetting:
                    {
                        SystemSetting.instance.initFromServerStr(_loc_6);
                        PerformanceUtil.instance.setEffectQulity(SystemSetting.instance.effectSetterType.value);
                        Log.system("SystemSettingType.SystemSetting: " + _loc_6);
                        NetDispatcher.dispatchCmd(ServerCommand.SystemSettingDataGot, null);
                        break;
                    }
                    case SystemSettingType.ClientSetting:
                    {
                        ClientSetting.server.initFromServerStr(_loc_6);
                        ClientSetting.local.initFromServerStr(_loc_6);
                        ClientSetting.isInited = true;
                        Log.system("SystemSettingType.ClientSetting: " + _loc_6);
                        NetDispatcher.dispatchCmd(ServerCommand.SystemClientSettingGot, null);
                        break;
                    }
                    case SystemSettingType.ExSkillShortcutBarData:
                    {
                        Log.system("SystemSettingType.ExSkillShortcutBarData: " + _loc_6);
                        Cache.instance.exSkillShortcut.initData(_loc_6);
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
            }
            return;
        }// end function

    }
}
